Skip to content

Instantly share code, notes, and snippets.

让两个子网内的设备可以互通访问
@wojteklu
wojteklu / clean_code.md
Last active May 9, 2024 06:46
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@mhSangar
mhSangar / install-textlive.sh
Created April 21, 2021 23:45
Latex Workshop VSCode settings for Biber and pdflatex and installation steps for textlive
#!/bin/bash
echo "Installing TextLive"
sudo apt install -y texlive-latex-extra
sudo apt install -y texlive-lang-english texlive-lang-spanish texlive-bibtex-extra
# sudo apt autoremove
@nathanctech
nathanctech / proxy-nginx-fxserver.md
Created May 1, 2020 14:23
FXServer Reverse Proxy

Proxying FiveM Connections using Nginx

As of server version 2377, support was added to FiveM to run a custom streaming proxy similar to cfx.re, but proxying the data connection (UDP) as well. This can be accomplished very easily with nginx acting as a proxy, and you can combine the caching proxy with it.

Requirements

  • Nginx 1.17+ (1.16 absolute minimum, guide tested on 1.17)
  • Server with reasonable network bandwidth (500mbps uplink strongly suggested)
  • FXserver version 2377 or later
  • SSL certificate for the domain you're using (highly recommended)
@willeccles
willeccles / sockets.h
Last active May 9, 2024 06:43
Cross-platform socket header for both POSIX sockets and Winsock
/*
* File: sockets.h
* Author: Will Eccles
* Date: 2020-03-12
*
* 1. Description
*
* This header attempts to make it easy to use sockets across platforms,
* for both Windows and POSIX systems. While Winsock is often somewhat
* compatible with Berkeley sockets, it is not strictly compatible,
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 9, 2024 06:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@yashaka
yashaka / how-to-add-markdown-to-tilda-page-ru.md
Last active May 9, 2024 06:43
Как добавить markdown в tilda

Как добавить markdown в tilda

Базовой функционал

1 В head страницы добавляем:

<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs@2/webcomponents-loader.min.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script>
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@xkikeg
xkikeg / zshhist.py
Last active May 9, 2024 06:44
Convert ZSH history file (.zsh_history file) between original weird encoding and proper UTF-8.
#!/usr/bin/env python3
"""
ZSH history convert script.
When you mistakenly type your password or quite bad command into ZSH,
you may want to remove the entry from the history.
The problem is, the .zsh_history is encoded in a weird format!
If you want to find a command with non-ASCII character, it'll be problematic.
@aatizghimire
aatizghimire / XRDP-MultiUser-Installation
Last active May 9, 2024 06:40
This is short tutorial to install XRDP on Ubuntu for multi-user Remote desktop connection.
--------------------------------------------
Xrdp Server (Remote Desktop) Installation:
--------------------------------------------
Tested in Ubuntu 22.04.03 LTS
1. Update Environment
$ sudo apt-get update
$ sudo apt-get upgrade